package com.xqboss.apps.dto.punch;

import com.xqboss.apps.dto.PageDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Objects;

/**
 * @author Trent
 * @date 2023/9/5
 */
@Data
@ApiModel
public class GetWebPunchRecordDto extends PageDto {

    @ApiModelProperty("打卡类型")
    private Integer type;

    @ApiModelProperty("开始时间")
    private LocalDateTime createTimeStart;

    @ApiModelProperty("结束时间")
    private LocalDateTime createTimeEnd;

    @ApiModelProperty("用户")
    private Long userId;

    @ApiModelProperty("是否实名 0否， 1是")
    private Integer isReal;

    public LocalDateTime getCreateTimeEnd() {
        if(Objects.nonNull(createTimeEnd)){
            return createTimeEnd.with(LocalTime.MAX);
        }
        return createTimeEnd;
    }
}
